//
//  iOSBinding.m
//  OXFAM_iOS
//
//  Created by Karl on 2017/3/27.
//  Copyright © 2017年 i-Craftsmen ltd. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UMAnalytics/MobClick.h>

#define GetStringParam( _x_ ) ( _x_ != NULL ) ? [NSString stringWithUTF8String:_x_] : [NSString stringWithUTF8String:""]

void _unityStatistics (const char *type){
    NSLog(@"%@",GetStringParam(type));
    [MobClick event:GetStringParam(type)];
}

void _targetSceneLoadCompleted(const char *scene){
    [[NativeViewManager sharedManager] targetSceneLoadCompleted:GetStringParam(scene)];
}
void _callNativeLanguage(){
    [[LocalizeManager sharedManager] setUnityLanguage];
}
void _showActivityIndicator(){
    
}
void _hideActivityIndicator(){
    
}
void _callNativeWebView(const char *url){
    if ([GetStringParam(url) isEqualToString:@"donate_url"]) {
        [[NativeViewManager sharedManager] showWebWithURL:Babel(@"donate_url") inApp:NO];
    }else{
        [[NativeViewManager sharedManager] showWebWithURL:GetStringParam(url) inApp:YES];
    }
    
}
void _callSavePhotoToAlbum(){
    [[NativeViewManager sharedManager] captureCompleted];
}
